@echo off
chcp 65001 >nul 2>&1
echo ========================================
echo Install Dependencies for Anti-Crash Optimization
echo ========================================
echo.

REM Check if Python is installed
python --version >nul 2>&1
if errorlevel 1 (
    echo Error: Python not found, please install Python first
    pause
    exit /b 1
)

echo Installing psutil...
pip install psutil==5.9.8

if errorlevel 1 (
    echo.
    echo Installation failed, trying with China mirror...
    pip install psutil==5.9.8 -i https://pypi.tuna.tsinghua.edu.cn/simple
)

echo.
echo ========================================
echo Installation Complete!
echo ========================================
echo.
echo You can now run the program. The software will automatically use optimized memory management.
echo.
pause